<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .big {
            perspective: 1000px;
        }
        .box {
            position: relative;
            width: 300px;
            height: 300px;
            margin: 400px auto;
            transform-style: preserve-3d;
            animation: rotate 6s infinite linear;
        }
        .box:hover {
            animation-play-state: paused;
        }
        .box>div {
            position: absolute;
            width: 100%;
            height: 100%;
            text-align: center;
            opacity: .3;
            text-align: center;
            font-size: 100px;
            line-height: 300px;
            border:1px solid #333;
        }

        .box>div:nth-child(1) {
            background-color: red;
            transform: translateY(-150px) rotateX(-90deg);
        }

        .box>div:nth-child(2) {
            background-color: purple;
            transform: translateZ(-150px);
        }

        .box>div:nth-child(3) {
            background-color: pink;
            transform: translateY(150px) rotateX(-90deg);
        }

        .box>div:nth-child(4) {
            background-color: green;
            transform: translateZ(150px);
        }

        .box>div:nth-child(5) {
            background-color: green;
            transform: translateX(-150px) rotateY(-90deg);
        }

        .box>div:nth-child(6) {
            background-color: green;
            transform: translateX(150px) rotateY(-90deg);
        }

        @keyframes rotate {
            from {
                transform: rotateX(0deg) rotateY(0deg);
            }
            to {
                transform: rotateX(360deg) rotateY(360deg);
            }
        }
    </style>
</head>

<body>
    <div class="big">
        <div class="box">
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
            <div>5</div>
            <div>6</div>
        </div>
    </div>
</body>

</html>